<%@page import="com.etc.zzsys.entity.Question"%>
<%@page import="com.etc.zzsys.entity.User"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">

<title>Dashboard Template for Bootstrap</title>

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="css/dashboard.css" rel="stylesheet">

</head>

<body>


	<div class="container-fluid">
				<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

				<!-- 表单开始 -->
				<form class="form-horizontal" role="form" action="qs?op=doAdd"
					method="post">
					<% 
					Question q=(Question)request.getAttribute("question");
					%>
					<div class="form-group">
						<label for="" class="col-sm-2 control-label">标题</label>
						<div class="col-sm-8">
							<input type="text" required="required" class="form-control"
								name="title" id="" value="<%=q.getTitle() %>" />
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-sm-2 control-label">内容</label>
						<div class="col-sm-6">
							<textarea name="content" required="required" rows="12" class="form-control"><%=q.getContent() %></textarea>
						</div>
					</div>

					<div class="form-group">
						<label for="" class="col-sm-2 control-label">用户名</label>
						<div class="col-sm-2">
							<select class="form-control" name="userId">
								<option>请选择</option>
								<%
									List<User> ulist=(List<User>)request.getAttribute("ulist");
									for(User u:ulist){
								%>
								<option  <% if(u.getUserId()==q.getUserId()){ out.print("selected='selected'");} %>  value="<%=u.getUserId() %>"><%=u.getUserName() %></option>
								<%
									}
								%>
							</select>
						</div>
					</div>
					

					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-danger">提交</button>
						</div>
					</div>
				</form>
				<!-- 表单结束 -->

			</div>
		</div>
	</div>


